<link href="../addons/jy_jdpm/resource/css/mobile/address-index.css" rel="stylesheet" type="text/css" >
<link href="../addons/jy_jdpm/resource/css/mobile/address-edit.css?v=1" rel="stylesheet" type="text/css" onload="$('#loadhtml').show()"> 
<style>
.placeholder{
        font-size:32px;!important;
}
.input-text-control {
  margin-left: 24px;
  padding: 16px 0 10px 0;
  border-bottom: 0.025rem solid #e5e5e5;
  font-size: 0;
  position: relative;
  background-color: #fff;
}
.input-text-control .label {
  font-size: 14px;
  color: #999999;
  display: inline-block;
  width: 150px;
  position: relative;
  box-sizing: border-box;
  text-align:left;
  padding-left: 10px;
  padding-bottom: 10px;
}
.input-text-control .label.width-large {
  width: 100px;
  vertical-align: middle;
}
.input-text-control .label::before {
  content: '*';
  position: absolute;
  left: 0;
  top: 10px;
  color: #fa4b24;
  font-size: 12px;
}
.input-text-control .label.no-required:before {
  content: '';
}
.input-text-control .weui-switch {
  vertical-align: middle;
}
.input-text-control .input {
  font-size: 14px;
  color: #333;
  width: 400px;
  margin-left: 20px
  border: 0 none;
  outline: none;
}
.input-text-control .jianmian {
  color: #e8cb56;
  font-size: 16px;
}
.input-text-control .icon-right {
  width: 8px;
  position: absolute;
  top: 50%;
  margin-top: -10px;
  right: 6px;
}
</style>
<div id="loadhtml" style="display:none;">
<form id="addressrForm" class="am-form am-form-horizontal" >
    <div class="container" ng-if="pagedata.op == 'main'">
        <ul class="address-list">
                <li class="address-item" ng-repeat="av in pagedata.list">
                    <div class="avatar-box">
                        <img src="{{pagedata.membersinfo.avatar || '../addons/jy_jdpm/resource/images/mobile/avatar.png'}}" alt="" class="avatar">
                    </div>
                    <div class="info">
                        <div class="user-info">
                            <span class="user-name">{{av.truename}}</span>
                            <span class="user-phone">{{av.mobile}}</span>
							<span ng-if="av.default ==1" class="address-default">[默认地址]</span>
                        </div>
                        <div class="address-info">{{av.provaddress.province}}{{av.provaddress.city}}{{av.provaddress.district}}{{av.address}}</div>
                    </div>
                    <div class="edit" href="javascript:;" ng-click="access_json('edit','id='+av.adid)">编辑</div>
                </li>
        </ul>
		<div class='content-empty' ng-show="pagedata.list.length<=0">
			<i class='fa fa-comment-o' style="font-size:40px"></i>
			<br/>您还没有任何收货地址
		</div>
		<div class="footer-button" style="text-align:center;line-height:40px;height:40px;margin:5px;">
            <div class="btn" id="add_address" style="font-size:15px;height:35px;line-height:36px;margin:3px 10px;color:#fff" ng-click="access_json('edit')">添加地址</div>
        </div>
	</div>
	<div class="container" ng-if="pagedata.op == 'edit'">
            <div class="form">

                    <div class="input-text-control">
                        <span class="label">收货人</span>
                        <input type="text"  class="input user_name" ng-model="pagedata.info.truename" placeholder="你的真实姓名" placeholder-class="placeholder" required>
                    </div>
                    <div class="input-text-control">
                        <span class="label">手机</span>
                        <input type="text" class="input user_phone" ng-model="pagedata.info.mobile" placeholder="请输入手机号码" required >
                    </div>
                    <div class="input-text-control">
                        <span class="label no-required">固定电话</span>
                        <input type="text" class="input user_phone" ng-model="pagedata.info.phone" value="{{pagedata.info.phone}}" placeholder="请输入固定电话" >
                    </div>
                    <div class="input-text-control">
                        <span class="label no-required">邮政邮编</span>
                        <input type="text" class="input postalcode" ng-model="pagedata.info.postalcode" value="{{pagedata.info.postalcode}}" placeholder="请输入邮政邮编">
                    </div>
                    <div class="input-text-control">
                        <span class="label">所在地区</span>
                        <div class="row" style="height:30px;padding-left:10px">
							<div class="col-sm-3" style="padding:0 5px;width:30%">
								<select ng-model="pagedata.info.provaddress.province" class="form-control tpl-province">
								<option value="" selected="selected">请选择省份</option>
								<option ng-repeat="(value,data) in pagedata.province" value="{{value}}" ng-selected="pagedata.info.provaddress.province==value">{{value}}</option>
								</select>
							</div>
							<div class="col-sm-3" style="padding:0 5px;width:30%">
								<select ng-model="pagedata.info.provaddress.city" class="form-control tpl-city">
								<option value="" selected="selected">请选择城市</option>
								<option ng-repeat="(value,data) in pagedata.province[pagedata.info.provaddress.province]" value="{{value}}" ng-selected="pagedata.info.provaddress.city==value">{{value}}</option>
								</select>
							</div>
							<div class="col-sm-3" style="padding:0 5px;width:30%">
								<select ng-model="pagedata.info.provaddress.district" class="form-control tpl-district">
								<option value="" selected="selected">请选择区县</option>
								<option ng-repeat="value in pagedata.province[pagedata.info.provaddress.province][pagedata.info.provaddress.city]" value="{{value}}" ng-selected="pagedata.info.provaddress.district==value">{{value}}</option>
								</select>
							</div>
						</div>
                    </div>
                    <div class="input-text-control">
                        <span class="label">详细地址</span>
                        <input type="text" class="input user_address_detail" ng-model="pagedata.info.address" placeholder="请输入详细地址" required>
                    </div>
                    <div class="input-text-control">
                        <span class="label width-large">设为默认地址</span>
                        <input type="radio" class="set-default" ng-checked="pagedata.info.default==1" value="{{pagedata.info.default}}" ng-click="pagedata.info.default = 1"/>
                    </div>
            </div>
    
        <div class="footer-button" style="text-align:center;line-height:40px;height:40px;margin:5px;">
            <div class="btn btn_save" style="font-size:15px;height:35px;line-height:36px;margin:3px 10px;color:#fff" ng-click="post(pagedata.info,'post')">保存地址</div>
        </div>
	</div>
</form>
</div>